package com.lib.framework.ext

import com.lib.framework.manager.ContextManager
import com.lib.framework.widget.WidgetUtil

/**
 * 尺寸扩展
 */
var Int.ddp: Int
    get() = WidgetUtil.dpTopx(ContextManager.applicationContext, this)
    set(_) {}

var Int.px2ddp: Double
    get() = WidgetUtil.pxTodp(ContextManager.applicationContext, this.toFloat()).toDouble()
    set(_) {}

var Double.ddp: Int
    get() = WidgetUtil.dpTopx(ContextManager.applicationContext, this.toInt())
    set(_) {}

var Float.ddp: Int
    get() = WidgetUtil.dpTopx(ContextManager.applicationContext, this.toInt())
    set(_) {}